package com.example.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.shop.bean.CollectBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CollectMapper extends BaseMapper<CollectBean> {

    @Select("select * from tbl_collect where uid=#{uid} and pid=#{pid}")
    List<CollectBean> listByUidPid(@Param("uid")int uid,@Param("pid") int pid);

    @Select("delete from tbl_collect where uid=#{uid} and pid=#{pid}")
    void cancelCollectByUidPid(@Param("uid")int uid,@Param("pid") int pid);

    @Select("select * from view_collect where uid=#{uid}")
    List<CollectBean> collectList(@Param("uid")int uid);

    @Select("select * from view2_collect ")
    List<CollectBean> collectList2();
}
